package com.fable.common.eunm;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    ERROR(0,"系统错误！请联系管理员"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    TOKEN_EXPIRED(401,"登录过期,需要重新登录"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "用户名不能为空"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    PASSWORD_ERROR(505,"密码错误"),
    BAN_USER(506, "用户已被封禁"),
    FILE_TYPE_ERROR (507,"文件类型错误，只能上传png类型"),
    USERNAME_NOT_NULL(508, "用户名不能为空"),
    NICKNAME_NOT_NULL(509, "昵称不能为空"),
    PASSWORD_NOT_NULL(510, "密码不能为空"),
    EMAIL_NOT_NULL(511, "邮箱不能为空"),
    NICKNAME_EXIST(512, "昵称已存在"),
    TOKEN_FAIL(513, "token异常"),
    REQUIRE_ROLENAME(518, "角色名称不能为空"),
    REQUIRE_CONTENT(520, "评论内容不能为空"),
    CAPTCHPA_EXPIRE(521, "验证码过期"),
    CAPTCHPA_ERROE(522, "验证码不匹配");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
